﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace app.Api
{
    #region 返回结果类
    public class Result
    {
        int _status = (int)STATUS.OK;
        public int status { get { return _status; } set { _status = value; } }
    }
    public class ObjectResult : Result
    {
        public object data { get; set; }
    }
    public class ListResult<T> : Result
    {
        public List<T> list { get; set; }
    }
    public class PageResult<T> : Result
    {
        public PageData<T> page { get; set; }
    }
    public class PageData<T>
    {
        public int current_page { get; set; }
        public int page_size { get; set; }
        public int total { get; set; }
        public List<T> list { get; set; }
    }
    public class IDResult : Result
    {
        public object id { get; set; }
    }
    public class EnumResult : Result
    {
        public int value { get; set; }
        public string name { get; set; }
    }
    public class BooleanResult : Result
    {
        public bool value { get; set; }
        public string message { get; set; }
    }
    public class ValueResult : Result
    {
        public object value { get; set; }
    }
    public class MessageResult : Result
    {
        public string message { get; set; }
    }
    #endregion
}